package cn.tedu._08security.service;

import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;

public class UserDetailsServiceImpl implements UserDetailsService {
    @Override
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
        return User.withUsername( username)
                .password("{noop}123456")  //未来是在数据控中查询出来的密码，{noop}表示密码是明文
                .authorities("sys:private:view","sys:private:edit")  //未来是在数据库中查询出来的该用户的权限
                .build();
    }
}
